﻿Create Procedure getCustomProfileData
    @UPN           varchar(128),
    @FullName       nvarchar(250) OUTPUT,
    @NumRows      int	  OUTPUT
AS

--Return data for the requested user in the application
select	
	@FullName	= FullName,
	@NumRows	= NumRows
from	dbo.UserProfiles pt,   dbo.Users u
where	
	u.UPN = @UPN AND
	u.UPN = pt.UPN
go

--grant EXECUTE on dbo.getCustomProfileData to [YOURMACHINENAME\ASPNET]
